<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>

<style>
    .el-carousel__item h3 {
        color: #475669;
        font-size: 14px;
        opacity: 0.75;
        line-height: 200px;
        margin: 0;
    }

    .el-carousel__item:nth-child(2n) {
        background-color: #99a9bf;
    }

    .el-carousel__item:nth-child(2n+1) {
        background-color: #d3dce6;
    }
</style>
<body>
<div id="app">

    <el-carousel :interval="2000" type="card" height="500px">
        <el-carousel-item v-for="img in imgList" :key="img.id">
            <img :src="'https://file.qaqavr.com/'+img.imgName" width="100%" height="100%">
        </el-carousel-item>
    </el-carousel>

    <div style="text-align: center;padding-top: 30px">
        <strong><span style="font-size: medium;font-family: 幼圆">青春是一个短暂的美梦, 当你醒来时, 它早已消失无踪</span></strong>
        <el-divider></el-divider>
        <span style="font-family: 新宋体">少量的邪恶足以抵消全部高贵的品质, 害得人声名狼藉</span>
    </div>
</div>
<script th:src="@{/axios.min.js}"></script>
<script th:src="@{/vue.js}"></script>

<!-- 引入样式 -->
<link rel="stylesheet" th:href="@{/element-ui.css}">
<!-- 引入组件库 -->
<script th:src="@{/element-ui.js}"></script>
<script>
    new Vue({
        el:"#app",
        data:{
          imgList:[]
        },
        methods:{
          findAll(){
              axios.get("/img/findAll").then(resp=>{
                  if (resp.data.flag){
                      localStorage.setItem("imgList",resp.data.data)
                      this.imgList=resp.data.data
                  } else {
                      this.$message.error(resp.data.message);
                  }
              })
          }
        },
        created() {
            this.findAll()
        }
    })
</script>
</body>
</html>